import { http } from "@/utils/http/axios";
const baseProfix = "/system/message/config";
/**
 * 分页查询消息配置
 * @returns
 */
export function getPageList(params = {}) {
	return http.request<API.Response.BasicResponse>({
		url: `${baseProfix}/page`,
		method: "GET",
		params
	});
}
// 根据ID查询
export function getConfig(id: number) {
	return http.request<API.System.MessageConfigVO>(
		{
			url: `${baseProfix}/${id}`,
			method: "GET"
		},
		{
			isTransformResponse: true
		}
	);
}
// 保存
export function save(params = {}) {
	return http.request<API.Response.BasicResponse>({
		url: `${baseProfix}`,
		method: "POST",
		data: params
	});
}
//更新
export function update(params = {}) {
	return http.request<API.Response.BasicResponse>({
		url: `${baseProfix}`,
		method: "PUT",
		data: params
	});
}
// 删除配置
export function remove(id: number | Array<number | undefined>) {
	return http.request<API.Response.BasicResponse>({
		url: `${baseProfix}/${id}`,
		method: "DELETE"
	});
}
export function selectOption(params = {}) {
	return http.request<API.Response.BasicResponse>(
		{
			url: `${baseProfix}/options`,
			method: "GET",
			params
		},
		{
			isTransformResponse: true
		}
	);
}
